#include "Triangle.h"
#include "float3.h"
namespace devii
{

Triangle::Triangle()
{
}

Triangle::~Triangle()
{
}


void Triangle::init(VertexBuffer* vb, TriangleEffect* effect)
{
	vertex_buffer = vb;
	this->effect = effect;

	std::vector<float3> mesh;
	mesh.push_back(float3(0.0f,0.0f,0.0f));
	mesh.push_back(float3(1.0f, 1.0f, 0.0f));
	mesh.push_back(float3(1.0f, 0.0f, 0.0f));

	vertex_buffer->pushBuffer(&mesh[0], 3, sizeof(float3), 0, false);
	vertex_buffer->setPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
	effect->init(vertex_buffer);

}

void Triangle::prepare()
{
	effect->prepare();
}
TriangleEffect* Triangle::getEffect()
{
	return effect;
}

VertexBuffer* Triangle::getVertexBuffer()
{
	return vertex_buffer;
}

}